using System;
using UnityEngine.UI;

namespace Gj
{
    public class TextStreamHelper : NodeHelper
    {
        private bool _init;
        private string _s;
        private Text _Text;

        private Text Text
        {
            get
            {
                if (_Text == null) _Text = GetComponent<Text>();
                return _Text;
            }
        }

        protected override BindDataType bindDataType => BindDataType.String;

        private void Update()
        {
            throw new NotImplementedException();
        }

        protected override void BindData(string s)
        {
            if (s == null) s = "";
            if (_s != null && _s.Equals(s)) return;
            _s = s;
            UpdateText(_s);
        }

        private void UpdateText(string s)
        {
        }
    }
}